package com.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.entity.Roadtransportvehicles;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/*
 *  @author 雨安
 *  类名： RoadtransportvehiclesMapper
 *  创建时间：2024/4/1
 */
@Repository
public interface RoadtransportvehiclesMapper extends BaseMapper<Roadtransportvehicles> {
    @Select("SELECT *\n" +
            "FROM roadtransportvehicles\n" +
            "WHERE (vehicle_no, operate_time) IN\n" +
            "      (SELECT vehicle_no, MIN(operate_time)\n" +
            "       FROM roadtransportvehicles\n" +
            "       GROUP BY vehicle_no)\n" +
            "ORDER BY operate_time")
    List<Roadtransportvehicles> getAllList();
}
